﻿using System;
using System.Collections;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Text;
using BLL;
using Model;

namespace AcceptServer
{
    public class OperateDataBase
    {

     
        private readonly BDeviceGpsInfo _bDeviceGps = new BDeviceGpsInfo();

        private readonly BDevice _bDevice = new BDevice();

        private readonly BPhoneUser _bPhoneUser = new BPhoneUser();

        public int AddGpsInfoInArray(DeviceGpsInfo[] gpsInfos)
        {
            return _bDeviceGps.AddGpsInfoInArray(gpsInfos);
        }

        public bool DeviceExists(string emi)
        {
            return _bDevice.Exists(emi);
        }

        public bool DeviceAdd(Model.DeviceInfo model)
        {
            return _bDevice.Add(model);
        }

        public bool DeviceUpdate(Model.DeviceInfo model)
        {
            return _bDevice.Update(model);
        }


        public PhoneUser PhoneUserGetModelByPhoneNumber(string phoneNumber)
        {
            return _bPhoneUser.GetModelByPhoneNumber(phoneNumber);
        }

        public bool PhoneUserAdd(PhoneUser model)
        {
            return _bPhoneUser.Add(model);
        }

        public bool PhoneUserUpdate(PhoneUser model)
        {
            return _bPhoneUser.Update(model);
        }
      
    }
}
